﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;

public partial class Controles_UCCalendario : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {
        MaskedEditExtender1.CultureName = ConfigurationManager.AppSettings["Idioma"];
    }
    [System.ComponentModel.Bindable(true)]
    public DateTime? Value
    {
        get
        {
            if (this.txtFecha.Text != string.Empty)
            {
                return DateTime.Parse(this.txtFecha.Text);
            }
            else
            {
                return DateTime.MinValue;
            }
        }
        set
        {
            if (value.HasValue)
            {
                this.txtFecha.Text = value.Value.ToShortDateString();
            }
            else
            {
                this.txtFecha.Text = "";
            }
        }
    }
    public bool Enabled
    {
        set
        {

            this.txtFecha.Enabled = value;
            this.imgFec.Disabled = !value;
            this.imgFec.Src = (value) ? "../Image/Botones/Calendar.gif" : "../Image/DisableCalendar.gif";
        }
        get
        {
            return this.txtFecha.Enabled;
        }
    }
    public string Texto
    {
        set
        {
            this.txtFecha.Text = value;
        }

        get
        {
            return this.txtFecha.Text;
        }
    }
    public short TabIndex
    {
        set
        {
            this.txtFecha.TabIndex = value;
        }

        get
        {
            return this.txtFecha.TabIndex;
        }
    }
    public TextBox txtFechaControl
    {
        get { return txtFecha; }
        set { txtFecha = value; }
    }

}
